package com.tang.model.simple;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/8/15 11:48
 * @Desc 产品的工厂 -> 简单工厂模式
 * @Remarks
 */
public class SimpleFactoryTest {
    public static void main(String[] args) {
//        Flyable flyable = new FlyableFactory().createFlyable("test");
//        if (flyable != null) {
//            flyable.fly();
//        }

//        Flyable flyable = new FlyableFactory().createFlyable(Rocket.class);
//        if (flyable != null) {
//            flyable.fly();
//        }
//        Flyable flyable = new FlyableFactory().createFlyableByEnum(FlyableEnum.BIRD);
//        if (flyable != null) {
//            flyable.fly();
//        }
        Rocket rocket = CommonFactory.factoryCreated(Rocket.class);
        rocket.fly();
    }
}
